package com.smartcommunity.service.people.impl;

import com.smartcommunity.bean.model.Pager;
import com.smartcommunity.bean.model.Result;
import com.smartcommunity.dao.people.BodyTemperatureDao;
import com.smartcommunity.entity.people.BodyTemperature;
import com.smartcommunity.entity.people.BodyTemperatureSearch;
import com.smartcommunity.service.people.BodyTemperatureService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 体温监测 服务类
 *
 * @author 渔七
 * @since 2.0.0
 */
@Service
@Slf4j
public class BodyTemperatureServiceImpl implements BodyTemperatureService {

    @Autowired
    private BodyTemperatureDao bodyTemperatureMapper;

    @Override
    public Result getTemperatureList(BodyTemperatureSearch search) {
        List<BodyTemperature> bodyTemperatureList = bodyTemperatureMapper.selectList(search);
        Integer count = bodyTemperatureMapper.selectCount(search);
        Pager<BodyTemperature> bodyTemperaturePager = new Pager<>(search.getPageNumber(), search.getPageSize(), count, bodyTemperatureList);
        return Result.ok(bodyTemperaturePager);
    }
}
